package com.treeste;

public class Student03 implements Comparable<Student> {
    private String nema;
    private int age;

    public Student03() {
    }

    public Student03(String nema, int age) {
        this.nema = nema;
        this.age = age;
    }

    public String getNema() {
        return nema;
    }

    public void setNema(String nema) {
        this.nema = nema;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student03{" +
                "nema='" + nema + '\'' +
                ", age=" + age +
                '}';
    }

    @Override
    public int compareTo(Student o) {
        int rete = this.age - o.geiage();
        rete = rete == 0 ? this.nema.compareTo(o.getName()) : rete;
        return rete;
    }
}
